blk-mq: introduce tag starvation observability#749
blk-mq: introduce tag starvation observability#749blktests-ci[bot] wants to merge 2 commits intolinus-master_basefrom
Conversation
|
Upstream branch: d60bc14 |
6b4d829 to
ceec5ed
Compare
|
Upstream branch: b4e0758 |
ad75ef4 to
ea3175d
Compare
ceec5ed to
3b54e52
Compare
|
Upstream branch: 6596a02 |
ea3175d to
5e1c43e
Compare
3b54e52 to
6a0b974
Compare
|
Upstream branch: 507bd4b |
5e1c43e to
1a6b31a
Compare
6a0b974 to
59ca59b
Compare
|
Upstream branch: dd6c438 |
1a6b31a to
b2b03b7
Compare
94f0438 to
857ada9
Compare
|
Upstream branch: dd6c438 |
b2b03b7 to
bbc7fed
Compare
|
Upstream branch: dd6c438 |
In high-performance storage environments, particularly when utilising RAID controllers with shared tag sets (BLK_MQ_F_TAG_HCTX_SHARED), severe latency spikes can occur when fast devices (SSDs) are starved of hardware tags when sharing the same blk_mq_tag_set. Currently, diagnosing this specific hardware queue contention is difficult. When a CPU thread exhausts the tag pool, blk_mq_get_tag() forces the current thread to block uninterruptible via io_schedule(). While this can be inferred via sched:sched_switch or dynamically traced by attaching a kprobe to blk_mq_mark_tag_wait(), there is no dedicated, out-of-the-box observability for this event. This patch introduces the block_rq_tag_wait trace point in the tag allocation slow-path. It triggers immediately before the thread yields the CPU, exposing the exact hardware context (hctx) that is starved, the specific pool experiencing starvation (hardware or software scheduler), and the total pool depth. This provides storage engineers and performance monitoring agents with a zero-configuration, low-overhead mechanism to definitively identify shared-tag bottlenecks and tune I/O schedulers or cgroup throttling accordingly. Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Reviewed-by: Laurence Oberman <[email protected]> Tested-by: Laurence Oberman <[email protected]> Signed-off-by: Aaron Tomlin <[email protected]>
In high-performance storage environments, particularly when utilising RAID controllers with shared tag sets (BLK_MQ_F_TAG_HCTX_SHARED), severe latency spikes can occur when fast devices are starved of available tags. This patch introduces two new debugfs attributes for each block hardware queue: - /sys/kernel/debug/block/[device]/hctxN/wait_on_hw_tag - /sys/kernel/debug/block/[device]/hctxN/wait_on_sched_tag These files expose atomic counters that increment each time a submitting context is forced into an uninterruptible sleep via io_schedule() due to the complete exhaustion of physical driver tags or software scheduler tags, respectively. To ensure negligible performance overhead even in production environments where CONFIG_BLK_DEBUG_FS is actively enabled, this tracking logic utilises dynamically allocated per-CPU counters. When this configuration is disabled, the tracking logic compiles down to a safe no-op. Signed-off-by: Aaron Tomlin <[email protected]>
bbc7fed to
50dc16e
Compare
Pull request for series with
subject: blk-mq: introduce tag starvation observability
version: 4
url: https://patchwork.kernel.org/project/linux-block/list/?series=1082868